package part04_观察者模式.p02_观察者模式解决;

/**
 * @ClassName: Client02
 * @Author: AllenSun
 * @Date: 2019/12/6 19:49
 */
public class Client02 {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        BaiduSite baiduSite = new BaiduSite();
        SinaSite sinaSite = new SinaSite();

        weatherData.registerObserver(baiduSite);
        weatherData.registerObserver(sinaSite);

        System.out.println("通知各个注册的观察者，看看信息");
        weatherData.setData(10f,100f,30f);

        weatherData.removeObserver(sinaSite);
        System.out.println();

        System.out.println("通知各个注册的观察者，看看信息");
        weatherData.setData(30f,200f,10f);

    }
}
